//导入vue-router
import { createRouter, createWebHistory } from 'vue-router'
//导入组件
import LoginVue from '@/views/LoginOrRegister.vue';
import Home from '@/views/home.vue'
// import LayoutVue from '@/views/Layout.vue'
import IMTable from '@/components/IMTable.vue'
import Rongziyulan from '@/views/Rongziyulan.vue'
import Rongzixiangqing from '@/views/Rongzixiangqing.vue'
//定义路由关系
const routes = [
    {
        path: '/login', 
        component: LoginVue 
    },
    {
        path: '/', 
        redirect:'/home'
    },
    {
        path: '/home',
        component: Home,
        children:[
            {
                path:'imtable',
                component:IMTable
            },
            {
                path:'rongziyulan',
                component:Rongziyulan
            },
            {
                path:'rongzixiangqing',
                component:Rongzixiangqing
            }
        ]
    }
]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
});

export default router